import java.util.ArrayList;


public abstract class TopicModelnew {
	//public static ccmixauthortopicPerplexity alist;
	protected double llh;

	public double getLlh() {
		return llh;
	}
	protected double pda;
	public double getpda() {
		return pda;
	}
	public void run(int iters, String filename) throws Exception {
		readDocs(filename);  
		initialize();
		
		System.out.println("Sampling...");
		double sum=0;
		double temp;
		
		for (int iter = 1; iter <= iters; iter++) {
		
			System.out.println("Iteration "+iter);
			doSampling();
			/*alist.doSampling();
			temp=alist.getaver();
			sum+=temp;
			if((iter%10)==0)
			{
				System.out.println("perplexityaver "+sum/10);
				sum=0;
			}*/
			
		}
		
		System.out.println("Final Log-Likehood...");
		likelihood();
		
		prediction();
		
		// write variable assignments

		writeOutput(filename);

		System.out.println("...done.");
	}
	
	public abstract void initialize();
	
	public abstract void doSampling();
	
	public abstract void readDocs(String filename) throws Exception;
	
	public abstract void writeOutput(String filename) throws Exception;
	
	public void prediction()
	{
		System.out.println("prediction() isn't been implemented!!!!!");
	}
	public void likelihood()
	{
		System.out.println("likelihood() isn't been implemented!!!!!");
	}
}
